package com.eureka.eurekaserviceinvoker.ping;

import com.netflix.loadbalancer.IPing;
import com.netflix.loadbalancer.Server;

import java.util.Random;

/**
 * 自定义Ping
 */
public class MyPing implements IPing {



    @Override
    public boolean isAlive(Server server) {
        Random random = new Random();
        boolean isAlive = random.nextBoolean();
        System.out.println("自定义 ping ,随机状态："+isAlive+" .真实状态: "+server.isAlive());
        return  isAlive;
    }



}
